/*
 * Copyright (c) 2018.
 * http://www.ulabcare.com
 */

package com.mt.roll.upms.vo;

import com.mt.roll.core.base.ITree;
import com.mt.roll.core.vo.CommonVo;
import com.mt.roll.core.vo.PageVo;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Builder;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

import javax.validation.constraints.Email;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.util.List;

/**
 * <p>
 * 系统组织表
 * </p>
 *
 * @author jiff
 * @date 2018/11/9
 * @since 1.0
 */
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@Builder
@ApiModel(value = "组织视图对象", description = "用于查询组织信息")
public class SysOrgVo extends CommonVo implements PageVo.ConvertVo, ITree<SysOrgVo> {

    private static final long serialVersionUID = 1L;

    /**
     * 主键，自增
     */
    @ApiModelProperty(value = "主键", required = true, example = "1")
    @NotNull(message = "组织ID不能为空")
    private Long id;

    /**
     * 区域ID
     */
    @ApiModelProperty(value = "区域ID", example = "0")
    @NotNull(message = "区域不能为空")
    private Long regionId;
    /**
     * 区域名称
     */
    @ApiModelProperty(value = "区域名称", example = "中国")
    private String regionName;

    /**
     * 父组织ID
     */
    @ApiModelProperty(value = "父组织ID", example = "0")
    @NotNull(message = "父组织不能为空")
    private Long parentId;

    /**
     * 家谱ID，格式：/rootId/.../grandfatherId/parentId/id
     */
    @ApiModelProperty(value = "家谱ID，格式：/rootId/.../grandfatherId/parentId/id", example = "/0/1")
    private String genealogyId;

    /**
     * 名称
     */
    @ApiModelProperty(value = "名称", example = "销售部")
    @NotBlank(message = "名称不能为空")
    private String name;

    /**
     * 联系人
     */
    @ApiModelProperty(value = "联系人", example = "jiff")
    private String contact;

    /**
     * 联系电话
     */
    @ApiModelProperty(value = "联系电话", example = "13588441519")
    private String phone;

    /**
     * 联系地址
     */
    @ApiModelProperty(value = "联系地址", example = "中国人工智能小镇")
    private String address;

    /**
     * 邮箱
     */
    @ApiModelProperty(value = "邮箱", example = "jiff@ulabcare.com")
    @Email
    private String email;

    /**
     * 选中状态，true：选中，否则未选中
     */
    @ApiModelProperty(value = "选中状态，true：选中，否则未选中", example = "true")
    private boolean checked;

    /**
     * 子列表
     */
    @ApiModelProperty(value = "子列表，用于获取组织树时才有数据", required = false)
    private List<SysOrgVo> children;

}
